//
// Created by Ivor_ on 2023/5/8.
//

#ifndef PHYSICAL_COMPUTING_PACKAGE_DIAGONALIZATION_H
#define PHYSICAL_COMPUTING_PACKAGE_DIAGONALIZATION_H

#include <malloc.h>
#include <math.h>
#include <complex.h>

/**
 * @author Ivor
 * @param size the size of the matrix, there are size*size numbers for a matrix
 * @param matrix the objective matrix to diagonalization
 * @param eigVecs empty spaces to save eigenvectors
 * @param eps the given accuracy for iteration
 * @return all the eigenvalues with the order of {@param eigVecs}, but not sorted
 * @remark suit for very small hermite matrix, especially real symmetric matrix, the algorithm has very high accuracy but very low speed, even not converging
 */
double* dJacobiD(int size, double** matrix, double** eigVecs, double eps);
_Complex double* cJacobiD(int size, _Complex double** matrix, _Complex double** eigVecs, double eps);

#endif //PHYSICAL_COMPUTING_PACKAGE_DIAGONALIZATION_H
